package file;

import java.io.File;

public class DeleteFileDemo {
    public static void main(String[] args) {
        File file=new File("demo.txt");
        if(file.exists()){
            file.delete();
            System.out.println("文件已删除");
        }
    else{
            System.out.println("该文件不存在");
        }
    boolean ex =file.exists();//不存在
        System.out.println(ex);

}}
